import axios from "../until/axios";
import api from "./api";

export const NewsList = () =>
  axios({
    method: "get",
    url: api.category.new,
    headers: {
      Authorization: window.localStorage.getItem("token"),
    },
  });

// 详细新闻分支
export const detail = () =>
  axios({
    method: "get",
    url: api.category.fezmk,
    headers: {
      Authorization: window.localStorage.getItem("token"),
    },
  });

// 点击后获取的详情

export const goodlun = (params) =>
  axios({
    method: "get",
    url: api.category.zhidi + `${params.id}`,
    headers: {
      Authorization: window.localStorage.getItem("token"),
    },
  });

// 广告轮播

export const lbpl = () =>
  axios({
    method: "get",
    url: api.category.swper,
    headers: {
      Authorization: window.localStorage.getItem("token"),
    },
  });

// 新闻列表
export const listnew = () =>
  axios({
    method: "get",
    url: api.category.newList,
    headers: {
      Authorization: window.localStorage.getItem("token"),
    },
  });

// 查看评论

export const pllist = (into) =>
  axios({
    method: "post",
    url: api.category.plli,
    headers: {
      Authorization: window.localStorage.getItem("token"),
    },
    data: into,
  });

  export const Allp = (params) =>
  axios({
    method: "get",
    url: api.category.Allpl +`?${params.id}`,
    headers: {
      Authorization: window.localStorage.getItem("token"),
    },
  });


  export const fenlei = () =>
  axios({
    method: "get",
    url: api.category.fenlei,
    headers: {
      Authorization: window.localStorage.getItem("token"),
    },
  });
  // 垃圾分类之后的详情
  export const fenleixq = () =>
  axios({
    method: "get",
    url: api.category.xq,
    headers: {
      Authorization: window.localStorage.getItem("token"),
    },
  });